import 'package:dark_notes/pages/homepage.dart';
import 'package:dark_notes/pages/settingspage.dart';
import 'package:flutter/material.dart';

class CustomDrawer extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Drawer(
      child: ListView(
        children: <Widget>[
          // DrawerHeader(child: Text('心雨笔记')),
          UserAccountsDrawerHeader(
            accountName: Text("心雨笔记"),
            accountEmail: Text("随时随地记录想法"),
            currentAccountPicture: CircleAvatar(
              backgroundColor: Theme.of(context).accentColor,
              backgroundImage: AssetImage("images/app_icon.png"),
            ),
          ),
          ListTile(
              title: Text('首页'),
              leading: Icon(Icons.note),
              onTap: () {
                Navigator.push(context,
                    MaterialPageRoute(builder: (context) => HomePage()));
              }),
          ListTile(
              title: Text('设置'),
              leading: Icon(Icons.settings),
              onTap: () {
                Navigator.push(context,
                    MaterialPageRoute(builder: (context) => SettingsPage()));
              }),
        ],
      ),
    );
  }
}
